package com.snap.awesomeserial;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Test {
    public static void main(String[] args) {

//        String ww = "2.00min";
//
//        String pattern = "[1-9]\\d*\\.?\\d*";
//        System.out.println(ww.replaceAll("\\.", ""));//1319999999
//        Pattern compile = Pattern.compile(pattern);
//        Matcher matcher = compile.matcher(ww);
        String value = "0.005";
        Pattern compile = Pattern.compile("\\d+\\.*\\d*");
        Matcher matcher = compile.matcher(value);
        if (matcher.find()){
            String string = matcher.group();//提取匹配到的结果
            System.out.println(string);//0.00
        }

//        int number = Integer.parseInt(string);
//        String unit=value.substring(string.length(),value.length());
//        System.out.println(unit);
//        boolean result=matcher.find();
//        System.out.println(result);
//        if (matcher.)
//        String string = matcher.group();
//        System.out.println(string);
//
//        String value ="200min";

//        matcher.find();
//        String string = matcher.group();
//        System.out.println(string);
//        int number = Integer.parseInt(string);
//        int index=value.lastIndexOf(string);
//
//        String unit=value.substring(index,value.length()-1);
//        System.out.println(unit);
    }
}
